<?php $tinhthanhs = $viewModel->get('tinhthanhs');   
      $loaidiadiems = $viewModel->get('loaidiadiems');   
?>

      <div class="container-fluid" style="width:97%">
      <form class="form-horizontal" method="POST">
        <div class="row top-page">
          <div class="col-xs-12 col-md-6">
              <h1><span class="glyphicon glyphicon-map-marker"></span> Địa điểm du lịch: Thêm địa điểm mới <span class="glyphicon glyphicon-plus-sign"></span></h1>
          </div>
           <div class="col-xs-12 col-md-6 save">
              <button type="submit" class="btn btn-primary btn1"><span class="glyphicon glyphicon-floppy-disk"></span> Lưu địa điểm</button>      
              <a href="<?php echo BASE_URL.'diadiemdulich' ?>" class="btn btn-success btn1"><span class="glyphicon glyphicon-arrow-left"></span> Quay lại </a>
          </div>
        </div>
        <div class="row title1">
          <div class="col-xs-12 col-md-8">
            <div class="form-group">
                <!-- <label for="inputEmail3" class="col-sm-2 control-label">Tiêu đề</label> -->
                <h2 class="col-sm-2 control-label">Tên địa điểm</h2>
                <div class="col-sm-10">
                    <input type="text" class="form-control input1" name="tendiem" id="inputEmail3" placeholder="Tên địa điểm" required>
                    <?php if (!empty($NameError)): ?>
                      <span class="help-inline"><?php echo $NameError;?></span>
                    <?php endif; ?>
                </div>
              </div>

          </div>
          <div class="col-xs-12 col-md-4">
               <h2 class="col-sm-2 control-label">Alias</h2>
                <div class="col-sm-10">
                    <input type="text" class="form-control input1" name="alias" id="inputEmail3" placeholder="Alias sinh tự động">
                    <?php if (!empty($NameError)): ?>
                      <span class="help-inline"><?php echo $NameError;?></span>
                    <?php endif; ?>
                </div>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-12 col-md-9">             
             
             <ul class="nav nav-tabs" role="tablist" id="myTab">
                <li class="active"><a href="#home" role="tab" data-toggle="tab">Nội dung</a></li>
                <li><a href="#profile" role="tab" data-toggle="tab">Hình ảnh</a></li>
                <li><a href="#messages" role="tab" data-toggle="tab">Clip</a></li>
               
              </ul>

              <div class="tab-content">
                <div class="tab-pane active" id="home">
                  <textarea name="mota" class="ckeditor" placeholder="Nhập bài viết" rows="10"></textarea> 
                    <?php if (!empty($ContentError)): ?>
                      <span class="help-inline"><?php echo $ContentError;?></span>
                    <?php endif; ?>     
                </div>
                <div class="tab-pane" id="profile">
                  <div class="form-group">
                   
                    <div class="col-sm-10">
                        <h2 class="title2">Chọn hình ảnh đại diện</h2>
                        <div class="row">
                          <input type="text" id="Image" style="width:42%; float:left; margin-left: 10px;" class="form-control" name="hinhanh" id="inputEmail3" placeholder="Chọn hình ảnh thumb">                      
                          <input type="button" id="BrowseImageIcon" style="width:20%; float:left" class="btn btn-success btn1" value="Duyệt ảnh" />
                        </div>
                        <hr>
                        <h2 class="title2">Các hình ảnh khác</h2>
                        <?php for ($i=1; $i <= MAX_IMAGE; $i++) { ?>
                        <div class="row rowimage">                          
                            <input type="text" id="description<?php echo $i ?>" class="form-control description1" name="description<?php echo $i ?>" id="inputEmail3" placeholder="Mô tả hình ảnh">                      
                            <input type="text" id="image<?php echo $i ?>" class="form-control image1" name="hinhanh<?php echo $i ?>" id="inputEmail3" placeholder="Chọn hình ảnh thumb">                      
                            <input type="button" id="browseImageIcon<?php echo $i ?>" class="btn btn-info browseImageIcon1" value="Duyệt ảnh" />                                          
                        </div>
                        <?php  } ?>
                        
                    </div>
                  </div>
                </div>
                <div class="tab-pane" id="messages">
                  <h2 class="title2">Thêm video cho địa điểm</h2>
                        <?php for ($i=1; $i <= MAX_VIDEO; $i++) { ?>
                        <div class="row rowimage">                          
                            <input type="text" id="video_description<?php echo $i ?>" class="form-control description1" name="video_description<?php echo $i ?>" id="inputEmail3" placeholder="Mô tả video">                      
                            <input type="text" id="video<?php echo $i ?>" class="form-control image1" name="video<?php echo $i ?>" id="inputEmail3" placeholder="Đường dẫn video">                      
                            <a href="" class="btn btn-info btnvideo"><span class="glyphicon glyphicon-eye-open"></span></a>
                            
                        </div>
                        <?php } ?>

                </div>
                
              </div>

              <script>
                $(function () {
                  $('#myTab a:last').tab('show')
                })
              </script>
          </div>
           <div class="col-xs-12 col-md-3">
             <h2 class="zone_title">Thông tin địa điểm</h2>
             <h2 class="title2">Tỉnh thành</h2>
             <select name="tinhthanh" class="form-control">
                       <?php foreach ($tinhthanhs as $tinhthanh) { ?> 
                            <option value="<?php echo $tinhthanh->TuKhoa; ?>"><?php echo $tinhthanh->TenTinh; ?></option>    
                       <?php } ?>
            </select>  

            <h2 class="title2">Loại địa điểm</h2>
             <select name="loaidiadiem" class="form-control">
                       <?php foreach ($loaidiadiems as $loaidiadiem) { ?> 
                            <option value="<?php echo $loaidiadiem->TuKhoa; ?>"><?php echo $loaidiadiem->TenLoaiDiaDiem; ?></option>    
                       <?php } ?>
            </select> 
             <h2 class="title2">Địa chỉ</h2>
            <input type="text" class="form-control" name="diachi" id="inputEmail3" placeholder="Địa chỉ" required>       
            <h2 class="title2">Kinh độ</h2>
            <input type="text" class="form-control" name="kinhdo" id="inputEmail3" placeholder="Kinh độ" required>            
            <h2 class="title2">Vĩ độ</h2>
            <input type="text" class="form-control" name="vido" id="inputEmail3" placeholder="Vĩ độ" required>
            <h2 class="title2">Tình trạng</h2>
              <select name="tinhtrang" class="form-control">                                                                       
                          <option value="Hoạt động">Hoạt động</option>   
                          <option value="Khóa">Khóa</option>                        
              </select>
        
          </div>
        </div>  
        </form>
      </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
   
    